#ifndef SURFACE_H_
#define SURFACE_H_

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_video.h"
#include <string>
#include "../common/utils/Logger.h"
#include "../SDLtoolkit/Color.h"
#include <iostream>
#include <math.h>

struct Rectangle {
	int x, y, w, h;
};



class Surface {

	friend class SDLEngine;

public:
	Surface();
	/*Crea una superficie con un archivo*/
	Surface(int x, int y, std::string path);

	/*Crea una sup vacía con las dimensiones para un SDL_Rect*/
	Surface(int x, int y, int w, int h);

	~Surface();

	void SetVideoMode(int width, int height, int bpp, Uint32 flags);



	/*Devuelve el atributo surface*/
	SDL_Surface* getSurface();
	SDL_Rect getRectangle();

	void resize(int w, int h);

	const SDL_PixelFormat* getFormat();

private:
	SDL_Surface* surface;
	SDL_Rect rectangle;

	Surface(SDL_Surface* surface);

	void updateDimensions(SDL_Rect* rect);
	void loadSurfaceImage(std::string path);
};

#endif /* SURFACE_H_ */
